GtkDialog: Manage action area visibility more carefully
authorMatthias Clasen <mclasen@redhat.com>
Sun, 20 Jul 2014 05:05:41 +0000 (01:05 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 20 Jul 2014 05:05:41 +0000 (01:05 -0400)
People expect to be able to call gtk_widget_show_all on the dialog
to make action widgets visible, as seen e.g. in
https://bugzilla.gnome.org/show_bug.cgi?id=733431

To keep this working, we can't always set no-show-all on the
action_box. Only set it when the action_area is not used and empty.

gtk/gtkdialog.c
gtk/resources/ui/gtkdialog.ui

index 4e6dbc00b9ec292b85a0fe0d290dec8d1d7cb868..0075f98973a3093a262bb70962e0159abc155d97 100644 (file)
@@ -444,7 +444,8 @@ add_cb (GtkContainer *container,
   if (priv->use_header_bar)
     g_warning ("Content added to the action area of a dialog using header bars");
 
-  gtk_widget_show (GTK_WIDGET (priv->action_box));
+  gtk_widget_set_visible (priv->action_box, TRUE);
+  gtk_widget_set_no_show_all (priv->action_box, FALSE);
 }
 
 static void
@@ -496,6 +497,7 @@ gtk_dialog_constructed (GObject *object)
     }
 
   gtk_widget_set_visible (priv->action_box, !priv->use_header_bar);
+  gtk_widget_set_no_show_all (priv->action_box, priv->use_header_bar);
 }
 
 static void
index 9c10772b3ddc27f9ad3f329e00a31513f4cc8364..7ea88376be99de6125ad5c1c27099a46039fc904 100644 (file)
@@ -25,7 +25,6 @@
         <child>
           <object class="GtkBox" id="action_box">
             <property name="visible">True</property>
-            <property name="no-show-all">True</property>
             <property name="can_focus">False</property>
             <style>
               <class name="dialog-action-box"/>